package cn.com.b2office.service;

import java.util.List;

import cn.com.b2office.domain.AccountActivity;
import cn.com.b2office.domain.Cart;
import cn.com.b2office.domain.Order;
import cn.com.b2office.domain.OrderItem;

public interface OrderService {
	List<Order> createOrder(Cart cart);

	List<Order> findOrders(String memberId, int firstResult, int maxResults);

	List<Order> findOrders(String memberId, int orderStatus, int firstResult,
			int maxResults);

	/**
	 * 取消订单
	 * 
	 * @param orderId
	 * @return
	 */
	void cancelOrder(String orderId);

	/**
	 * 申请取消订单
	 * 
	 * @param orderId
	 * @return
	 */
	void appCancelOrder(String orderId);

	Order getOrder(String orderId);

	List<OrderItem> getOrderItems(String orderId);

	/**
	 * 获取与该订单相关的帐户活动记录
	 * 
	 * @param orderId
	 * @return
	 */
	List<AccountActivity> getOrderAccountActivity(String orderId);

	/**
	 * create Order objects from cart
	 * 
	 * @param cart
	 * @return
	 */
	List<Order> buildOrders(Cart cart);
	
	/** 查询不同状态的订单数*/
	int getTotalRecordNumByOrderStatus(String memberId, int orderStatus);
}
